﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BA2009.Entities;
using BA2009.Data.DataAccess;
using BA2009.Data.Filters;

namespace BA2009.Services
{
     public class BannerPositionService :ServiceBase<BannerPosition>,IBannerPositionService
     {
          public BannerPositionService(IRepository<BannerPosition> repository)
          {
               //if (repository == null)
               //     repository = new BannerPositionRepository();
               this.repository = repository;
          }

          //public BannerPositionService()
          //     :this(null)
          //{}

          public IList<BannerPosition> GetBannerPositionByPageId(int pageId)
          {
              return repository.FindAll().FilterByPageId(pageId).ToList();
          }

          #region IBannerPositionService Members

          IList<Banner> IBannerPositionService.GetAllBanner()
          {
               return new BannerRepository().FindAll().ToList();
          }

          #endregion

     }
  
}
